/*-------------------------------------------------------- 
* Module Name : OLPixmapWidget
* Version : 1.0
* 
* Software Name : Qt App Template
* Version : 1.0
*
* Copyright � 2010 � 2011 France T�l�com
* This software is distributed under the LGPL v2.1 license,
* the text of which is available at http://www.gnu.org/licenses/lgpl-2.1.html
* or see the "LICENSE.txt" file for more details.
*
*--------------------------------------------------------
* File Name   : OLPixmapWidget.h
*
* Created     : 07 June 2011
* Author(s)   : Omer Saleem
*
* Description :
* A container class used by the framework to display an
* image. Allows the image to be used as a QWidget-derived 
* class and used in layouts.
*
*--------------------------------------------------------
* 1.0 - First open source release
*
*/

#ifndef OLPIXMAPWIDGET_H
#define OLPIXMAPWIDGET_H

#include <QWidget>

class OLPixmapWidget : public QWidget
{
    Q_OBJECT
    Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)

public:
    OLPixmapWidget(const QPixmap& pixmap, QWidget *parent = 0);
    OLPixmapWidget(const QString& pixmap, QWidget *parent = 0);

    const QPixmap& pixmap() const;

    void setOpacity(qreal opacity);
    qreal opacity();

protected:
    virtual void paintEvent(QPaintEvent *e);

private:
    QPixmap m_pixmap;
    qreal m_opacity;
};

#endif // OLPIXMAPWIDGET_H
